package com.applancer.provider;

import android.content.Context;
import android.net.ConnectivityManager;
import android.util.Log;

public class NetworkChecking {

	protected static String TAG = "applancerCMS";
	
	public static Boolean checkConnection(Context ct)
	{
		ConnectivityManager cm = (ConnectivityManager)ct.getSystemService(Context.CONNECTIVITY_SERVICE);
	    // test for connection
	    if (cm.getActiveNetworkInfo() != null
	            && cm.getActiveNetworkInfo().isAvailable()
	            && cm.getActiveNetworkInfo().isConnected()) {
	        return true;
	    } else {
	        Log.v(TAG, "Internet Connection Not Present");
	    }
	    
	    return false;
	}

}
